﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace IMeiWeiWebService.Providers
{
    public class AreaProvider
    {
        IMeiWei.BLL.areaone bll_areaOne = new IMeiWei.BLL.areaone();
        IMeiWei.BLL.areatwo bll_areaTwo = new IMeiWei.BLL.areatwo();
        public List<IMeiWei.Model.areaone> LoadAreaOneLeval()
        {
            return bll_areaOne.GetModelList(" 1 = '1'");
        }

        public List<IMeiWei.Model.areatwo> LoadAreaTwoLeval(string areaOneId)
        {
            return bll_areaTwo.GetModelList(" AreaOne_Id = '" + areaOneId + "'");
        }

        public List<IMeiWei.Model.areatwo> LoadAreaTwoLeval()
        {
            return bll_areaTwo.GetModelList(" 1='1'");
        }
        public string SaveAreaTwoes(string id, string areaOne_Id, string areaTwoName)
        {
            IMeiWei.Model.areatwo modle_areaTwo = new IMeiWei.Model.areatwo();

            modle_areaTwo.Id = id;
            modle_areaTwo.AreaTwo = areaTwoName;
            modle_areaTwo.AreaOne_Id = areaOne_Id;
            modle_areaTwo.AreaTwoStatus = "ACTIVE";
            modle_areaTwo.CreateBy = "SYSTEM_SET";
            modle_areaTwo.CreateTime = DateTime.Now;
            modle_areaTwo.MofifyBy = "SYSTEM_SET";
            modle_areaTwo.ModifyTime = DateTime.Now;

            bll_areaTwo.Add(modle_areaTwo);

            return "SUCCESS";
        }
    }
}